00001 // Emacs Mode Line: -*- Mode:c++;-*- 00002 // ------------------------------------------------------------- 00003 /* 00004 * Copyright (c) 2013 Battelle Memorial Institute 00005 * Licensed under modified BSD License. A copy of this license can be found 00006 * in the LICENSE file in the top level directory of this distribution. 00007 */ 00008 // ------------------------------------------------------------- 00009 /** 00010 * @file implementation_visitor.hpp 00011 * @author William A. Perkins 00012 * @date 2015-03-05 12:51:12 d3g096 00013 * 00014 * @brief 00015 * 00016 * 00017 */ 00018 00019 // ------------------------------------------------------------- 00020 // ------------------------------------------------------------- 00021 // Created April 1, 2013 by William A. Perkins 00022 // Last Change: Thu Jun 3 06:45:08 2010 by William A. Perkins <d3g096@PE10900.pnl.gov> 00023 // ------------------------------------------------------------- 00024 00025 #ifndef _implementation_visitor_hpp_ 00026 #define _implementation_visitor_hpp_ 00027 00028 #include <gridpack/utilities/uncopyable.hpp> 00029 00030 namespace gridpack { 00031 namespace math { 00032 00033 class PetscVectorWrapper; 00034 class PetscMatrixWrapper; 00035 00036 // ------------------------------------------------------------- 00037 // class ImplementationVisitor 00038 // ------------------------------------------------------------- 00039 /** 00040 * This is a cyclic visitor for the various math implementation 00041 * classes. It is intended to be use as a parent class for things 00042 * that are used to extract implementation-specific information from 00043 * an implementation agnostic class. 00044 * 00045 * To be safe, these should be used simultaneously on all processes. 00046 */ 00047 00048 class ImplementationVisitor : private utility::Uncopyable { 00049 public: 00050 00051 /// Default constructor. 00052 ImplementationVisitor(void); 00053 00054 /// Destructor 00055 virtual ~ImplementationVisitor(void); 00056 00057 /// The default visit (should just assert or do nothing) 00058 virtual void visit(PetscVectorWrapper&); 00059 virtual void visit(PetscMatrixWrapper&); 00060 }; 00061 00062 // ------------------------------------------------------------- 00063 // class ConstImplementationVisitor 00064 // ------------------------------------------------------------- 00065 /** 00066 * This is const version of a cyclic visitor for the various math 00067 * implementation classes. It is intended to be used as a parent class 00068 * for things that are used to extract implementation-specific 00069 * information from an const implementation agnostic class. 00070 * 00071 * To be safe, these should be used simultaneously on all processes. 00072 */ 00073 class ConstImplementationVisitor : private utility::Uncopyable { 00074 public: 00075 00076 /// Default constructor. 00077 ConstImplementationVisitor(void); 00078 00079 /// Destructor 00080 virtual ~ConstImplementationVisitor(void); 00081 00082 /// The default visit, const version (should just assert or do nothing) 00083 virtual void visit(const PetscVectorWrapper&); 00084 virtual void visit(const PetscMatrixWrapper&); 00085 }; 00086 00087 } // namespace math 00088 } // namespace gridpack 00089 00090 #endif